package com.cha.chaCommon.core.common;


import com.cha.chaCommon.core.exception.CustomerException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/*
@Author  hkf
@date 2024/9/5
--轻舟已过万重山--
*/
@RestControllerAdvice
public class MyGlobalHandler {
    @ExceptionHandler(CustomerException.class)
    public R myHandler(CustomerException e){
        System.out.println("全局异常打印:"+e.getMsg());
        return R.fail(e.getCode(),e.getMsg());
    }
}
